package com.tkk.monitoring;

import com.tkk.monitoring.server.ProxyServer;
import org.apache.commons.cli.*;

/**
 * author: Tkk
 * date: 2015/7/7
 */
public class Bootstrap {

    public static void main(String[] args) {
        CommandLineParser parser = new DefaultParser();
        Options options = new Options();
        options.addOption("port", false, "代理端口号, 默认是52222");
        CommandLine commandLine = null;
        try {
            commandLine = parser.parse(options, args);
        } catch (ParseException e) {
            e.printStackTrace();
        }

        //
        int port = 52222;
        if (commandLine.hasOption("port")) {
            port = Integer.parseInt(commandLine.getOptionValue("port"));
        }

        //
        ProxyServer.start(port);
    }
}
